package utils;

/**
 * @program: pangu
 * @description:
 * @author: fengjd
 * @create: 2022-06-22 11:22
 **/

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.slf4j.MDC;

public class Logging {
    public static void main(String[] args) {
        Logger log = LoggerFactory.getLogger("sasas");

        String a = "BOB";

        try {
            log.info("Hello");

            MDC.put("userid", a);

            log.debug("Texting 1");

        } catch (Exception e) {
            log.error(e.getMessage());

        } finally {
            MDC.remove("userid");

        }
    }
}
